home *** CD-ROM | disk | FTP | other *** search
/ Animation How-To / Animation How-to CD.iso / PLY / CHAPTER5 / BROWNIAN / BROWNIAN.PI next >
Text File  |  1994-01-01  |  3KB  |  88 lines

  1. // BROWNIAN.PI
  2. // Brownian Random Number Generator
  3. // 
  4. // By observation, brownian shifts a vector by
  5. // plus or minus 0.1, so applying brownian to 
  6. // a vector <0.1,0.1,0.1> and then multiplying
  7. // it by 5 gives vector components ranging from 
  8. // 0 to 1, just like RND.
  9.  
  10. start_frame 0
  11. end_frame 25
  12. total_frames 25
  13.  
  14. outfile brown
  15.  
  16. include "\ply\colors.inc"
  17.  
  18. viewpoint {
  19.    from <2.5,2.0,1.5>
  20.    at <0,0,0>
  21.    up <0,1,0>
  22.    angle 35
  23.    resolution 160,100
  24.    aspect 1.43
  25.    }
  26.  
  27. background SkyBlue
  28.  
  29. spot_light white, < 5, 0.5, 0.5>, <0.5,0.5,0.5>,3,15,25 // x
  30. spot_light white, < 0.5, 5, 0.5>, <0.5,0.5,0.5>,3,15,25 // y
  31. spot_light white, < 0.5, 0.5, 5>, <0.5,0.5,0.5>,3,15,25 // z
  32.  
  33. //object { cylinder < 5, 0.55, 0.55>, <0.5,0.5,0.5>,0.01 matte_black }
  34. //object { cylinder < 0.55, 5, 0.55>, <0.5,0.5,0.5>,0.01 matte_black }
  35. //object { cylinder < 0.55, 0.55, 5>, <0.5,0.5,0.5>,0.01 matte_black }
  36.  
  37. define v01 [5*brownian(<0.1,0.1,0.1>)]
  38. define v02 [5*brownian(<0.1,0.1,0.1>)]
  39. define v03 [5*brownian(<0.1,0.1,0.1>)]
  40. define v04 [5*brownian(<0.1,0.1,0.1>)]
  41. define v05 [5*brownian(<0.1,0.1,0.1>)]
  42. define v06 [5*brownian(<0.1,0.1,0.1>)]
  43. define v07 [5*brownian(<0.1,0.1,0.1>)]
  44. define v08 [5*brownian(<0.1,0.1,0.1>)]
  45. define v09 [5*brownian(<0.1,0.1,0.1>)]
  46.  
  47. object {sphere <v01[0][0],v01[0][1],v01[0][2]>,0.05 shiny_red }
  48. object {sphere <v02[0][0],v02[0][1],v02[0][2]>,0.05 shiny_red }
  49. object {sphere <v03[0][0],v03[0][1],v03[0][2]>,0.05 shiny_red }
  50. object {sphere <v04[0][0],v04[0][1],v04[0][2]>,0.05 shiny_red }
  51. object {sphere <v05[0][0],v05[0][1],v05[0][2]>,0.05 shiny_red }
  52. object {sphere <v06[0][0],v06[0][1],v06[0][2]>,0.05 shiny_red }
  53. object {sphere <v07[0][0],v07[0][1],v07[0][2]>,0.05 shiny_red }
  54. object {sphere <v08[0][0],v08[0][1],v08[0][2]>,0.05 shiny_red }
  55. object {sphere <v09[0][0],v09[0][1],v09[0][2]>,0.05 shiny_red }
  56.  
  57. define a01 < 1, 1, 1>
  58. define a02 < 1, 1, 0>
  59. define a03 < 1, 0, 0>
  60. define a04 < 1, 0, 1>
  61.  
  62. define a05 <0, 1, 1>
  63. define a06 <0, 1, 0>
  64. define a07 <0, 0, 0>
  65. define a08 <0, 0, 1>
  66.  
  67. object { cylinder a01,a02,0.02 matte_black }
  68. object { cylinder a02,a03,0.02 matte_black }
  69. object { cylinder a03,a04,0.02 matte_black }
  70. object { cylinder a04,a01,0.02 matte_black }
  71.  
  72. object { cylinder a05,a06,0.02 matte_black }
  73. object { cylinder a06,a07,0.02 matte_black }
  74. object { cylinder a07,a08,0.02 matte_black }
  75. object { cylinder a08,a05,0.02 matte_black }
  76.  
  77. object { cylinder a01,a05,0.02 matte_black }
  78. object { cylinder a02,a06,0.02 matte_black }
  79. object { cylinder a03,a07,0.02 matte_black }
  80. object { cylinder a04,a08,0.02 matte_black }
  81.  
  82. object { polygon 4, a05,a06,a07,a08 matte_white}
  83. object { polygon 4, a03,a07,a08,a04 matte_white}
  84. object { polygon 4, a02,a06,a07,a03 matte_white}
  85.  
  86.  
  87.  
  88.